#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>

using namespace std;

int main()
{
	int n;
	int m = 4;
	while (m--)
	{
		scanf("%d", &n);
		int num_1 = n / 7;
		int num_2 = n % 7;
		int count = num_1 * 15;
		switch (num_2)
		{
		case 1:count += 3;
			break;
		case 2:count += 5;
			break;
		case 3:count += 6;
			break;
		case 4:count += 9;
			break;
		case 5:count += 10;
			break;
		case 6:count += 12;
			break;
		//default:count += 0;
		}
		cout << count << endl;
	}
	return 0;
}